<style>

    .sortinput{

        width:48px;height:36px;border:#ccc 1px solid;text-align: center;

    }

    </style>
<style>
    .c_box{
        margin:10px;
        cursor: pointer;
    }
    .cur{
        color:red;
    }
    .optiontext{
        padding-top: 5px;
        text-align: left; vertical-align: middle;
    }
</style>

<div class="content">
    <div class="panel panel-default panel-intro">
        <div class="panel-body">
            <div id="" class="tab-content">
                <div class="tab-pane fade active in" id="one">
                    <div class="widget-body no-padding">
                        <div class="bootstrap-table">
                            <div class="fixed-table-toolbar">
                                <div class="bs-bars pull-left">
                                    <div style="margin-bottom: 10px;">
                                        {volist name="type" id="type_mark" key="k"}
                                            <a href="/admin/mark/index?type={$k-1}" class="c_box {if condition='$search eq $k-1'}cur{/if}">{$type_mark}</a>
                                        {/volist}
                                    </div>

                                    <div id="toolbar" class="toolbar" style="position: relative;">
                                        <a href="/admin/mark/mark_add?fid=0" class="btn btn-success btn-add " title="添加"><i class="fa fa-plus"></i> 添加</a>
                                    </div>
                                </div>
                                <table id="" class="table table-striped table-bordered table-hover table-nowrap" data-operate-edit="1" data-operate-del="1" width="100%">
                                    <thead>

                                    <tr>
                                        <th style="text-align: center; vertical-align: middle;width:5%;" data-field="id"><div class="th-inner ">id</div><div class="fht-cell"></div></th>

                                        <th style="text-align: center; vertical-align: middle;width:30%;" data-field="title"><div class="th-inner ">显示标题</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle;width:15%;" data-field="type"><div class="th-inner ">类型</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle;width:10%;" data-field="type"><div class="th-inner ">是否热词</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle;width: 17%;" data-field="operate"><div class="th-inner ">操作</div><div class="fht-cell"></div>
                                        </th>
                                    </tr>
                                    </thead>

                                        <tbody data-listidx="0">
                                        {volist name="list" id="first"}
                                        <tr data-index="0">
                                            <td style="text-align: center; vertical-align: middle; ">{$first.id}</td>
                                            <td style="text-align: left; vertical-align: middle; ">
                                                <?php if($first['m_level']>0){echo str_repeat('&nbsp;', $first['m_level']*8);} ?> |--{$first.mark_info}
                                            </td>

                                            <td style="text-align: center; vertical-align: middle; ">
                                                {$type[$first['mark_type']]}
                                            </td>

                                            <td style="text-align: center; vertical-align: middle; "> {if $first['ishot']==0}
                                                <span style="color:green;"></span>
                                                {else}
                                                <span style="color:darkred;">热词</span>
                                                {/if}
                                            </td>
                                            <td style="text-align: right; vertical-align: middle; ">
                                                <a href="javascript:;"  onclick="sort_sub('{$first.id}')" class="btn btn-success btn-edit btn-disabled" title="排序"> 子节点排序</a>
                                                <a href="/admin/mark/mark_add?fid={$first.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-plus"></i> 添加子节点</a>
                                                <a href="/admin/mark/mark_edit?id={$first.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-pencil"></i> 编辑</a>
                                                <a href="javasrcipt:;"  onclick="mark_del('{$first.id}');" class="btn btn-danger btn-del btn-disabled" title="删除"><i class="fa fa-trash"></i> 删除</a>
                                            </td>
                                        </tr>

                                            {if condition="$first['children'] neq ''"}
                                            {volist name="$first['children']" id="second"}

                                            <tr data-index="0">
                                                <td style="text-align: center; vertical-align: middle; ">{$second.id}</td>
                                                <td style="text-align: left; vertical-align: middle; ">
                                                    <?php {echo str_repeat('&nbsp;', $second['m_level']*8);} ?> |--{$second.mark_info}
                                                </td>
                                                <td style="text-align: center; vertical-align: middle; ">
                                                    {$type[$second['mark_type']]}
                                                </td>

                                                <td style="text-align: center; vertical-align: middle; "> {if $second['ishot']==0}
                                                    <span style="color:green;"></span>
                                                    {else}
                                                    <span style="color:darkred;">热词</span>
                                                    {/if}
                                                </td>



                                                <td style="text-align: right; vertical-align: middle; ">
                                                    <a href="javascript:;"  onclick="sort_sub('{$second.id}')" class="btn btn-success btn-edit btn-disabled" title="排序"> 子节点排序</a>
                                                    <a href="/admin/mark/mark_add?fid={$second.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-plus"></i> 添加子节点</a>
                                                    <a href="/admin/mark/mark_edit?id={$second.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-pencil"></i> 编辑</a>
                                                    <a href="javasrcipt:;"  onclick="mark_del('{$second.id}');" class="btn btn-danger btn-del btn-disabled" title="删除"><i class="fa fa-trash"></i> 删除</a>
                                                </td>
                                            </tr>


                                              {if condition="$second['children'] neq ''"}
                                              {volist name="$second['children']" id="third"}

                                              <tr data-index="0">
                                                  <td style="text-align: center; vertical-align: middle; ">{$third.id}</td>
                                                  <td style="text-align: left; vertical-align: middle; ">
                                                      <?php echo str_repeat('&nbsp;', $third['m_level']*8); ?> |&#45;&#45;{$third.mark_info}
                                                  </td>
                                                  <td style="text-align: center; vertical-align: middle; ">
                                                      {$type[$third['mark_type']]}
                                                  </td>

                                                  <td style="text-align: center; vertical-align: middle; "> {if $third['ishot']==0}
                                                      <span style="color:green;"></span>
                                                      {else}
                                                      <span style="color:darkred;">热词</span>
                                                      {/if}
                                                  </td>
                                                  <td style="text-align: right; vertical-align: middle; ">
                                                      <a href="javascript:;"  onclick="sort_sub('{$third.id}')" class="btn btn-success btn-edit btn-disabled" title="排序">子节点排序</a>
                                                      <a href="/admin/mark/mark_add?fid={$third.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-plus"></i> 添加子节点</a>
                                                      <a href="/admin/mark/mark_edit?id={$third.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-pencil"></i> 编辑</a>
                                                      <a href="javasrcipt:;"  onclick="mark_del('{$third.id}');" class="btn btn-danger btn-del btn-disabled" title="删除"><i class="fa fa-trash"></i> 删除</a>
                                                  </td>
                                              </tr>

                                                    {if condition="$third['children'] neq ''"}
                                                    {volist name="$third['children']" id="fourth"}

                                                    <tr data-index="0">
                                                        <td style="text-align: center; vertical-align: middle; ">{$fourth.id}</td>

                                                        <td style="text-align: left; vertical-align: middle; ">
                                                            <?php echo str_repeat('&nbsp;', $fourth['m_level']*8); ?>  |&#45;&#45;{$fourth.mark_info}
                                                        </td>
                                                        <td style="text-align: center; vertical-align: middle; ">
                                                            {$type[$fourth['mark_type']]}
                                                        </td>

                                                        <td style="text-align: center; vertical-align: middle; "> {if $fourth['ishot']==0}
                                                            <span style="color:green;"></span>
                                                            {else}
                                                            <span style="color:darkred;">热词</span>
                                                            {/if}
                                                        </td>

                                                        <td style="text-align: right; vertical-align: middle; ">
                                                            <a href="javascript:;"  onclick="sort_sub('{$fourth.id}')" class="btn btn-success btn-edit btn-disabled" title="排序"> 子节点排序</a>
                                                            <a href="/admin/mark/mark_add?fid={$fourth.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-plus"></i> 添加子节点</a>
                                                            <a href="/admin/mark/mark_edit?id={$fourth.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-pencil"></i> 编辑</a>
                                                            <a href="javasrcipt:;"  onclick="mark_del('{$fourth.id}');" class="btn btn-danger btn-del btn-disabled" title="删除"><i class="fa fa-trash"></i> 删除</a>
                                                        </td>
                                                    </tr>
                                                        {if condition="$fourth['children'] neq ''"}
                                                        {volist name="$fourth['children']" id="fifth"}

                                                        <tr data-index="0">
                                                            <td style="text-align: center; vertical-align: middle; ">{$fifth.id}</td>
                                                            <td style="text-align: left; vertical-align: middle; ">
                                                                <?php echo str_repeat('&nbsp;', $fifth['m_level']*8); ?>|&#45;&#45;{$fifth.mark_info}
                                                            </td>
                                                            <td style="text-align: center; vertical-align: middle; ">
                                                                {$type[$fifth['mark_type']]}
                                                            </td>

                                                            <td style="text-align: center; vertical-align: middle; "> {if $fifth['ishot']==0}
                                                                <span style="color:green;"></span>
                                                                {else}
                                                                <span style="color:darkred;">热词</span>
                                                                {/if}
                                                            </td>
                                                            <td style="text-align: right; vertical-align: middle; ">
                                                                <a href="/admin/mark/mark_son_sort?id={$fifth.id}" class="btn btn-success btn-edit btn-disabled" title="排序"> 子节点排序</a>
                                                                <a href="/admin/mark/mark_add?fid={$fifth.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-plus"></i> 添加子节点</a>
                                                                <a href="/admin/mark/mark_edit?id={$fifth.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-pencil"></i> 编辑</a>
                                                                <a href="javasrcipt:;"  onclick="mark_del('{$fifth.id}');" class="btn btn-danger btn-del btn-disabled" title="删除"><i class="fa fa-trash"></i> 删除</a>
                                                            </td>
                                                        </tr>
                                                            {if condition="$fifth['children'] neq ''"}
                                                            {volist name="$fifth['children']" id="sixth"}

                                                            <tr data-index="0">
                                                                <td style="text-align: center; vertical-align: middle; ">{$sixth.id}</td>

                                                                <td style="text-align: left; vertical-align: middle; ">
                                                                     <?php echo str_repeat('&nbsp;', $sixth['m_level']*8); ?>|&#45;&#45;{$sixth.mark_info}
                                                                </td>
                                                                <td style="text-align: center; vertical-align: middle; ">
                                                                    {$type[$sixth['mark_type']]}
                                                                </td>

                                                                <td style="text-align: center; vertical-align: middle; "> {if $sixth['ishot']==0}
                                                                    <span style="color:green;"></span>
                                                                    {else}
                                                                    <span style="color:darkred;">热词</span>
                                                                    {/if}
                                                                </td>



                                                                <td style="text-align: right; vertical-align: middle; ">
                                                                   <!-- <a href="/admin/mark/mark_add?fid={$sixth.id}" class="btn btn-success btn-edit btn-disabled" title="添加"><i class="fa fa-pencil"></i> 添加子节点</a>-->
                                                                    <a href="/admin/mark/mark_edit?id={$sixth.id}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-pencil"></i> 编辑</a>
                                                                    <a href="javasrcipt:;"  onclick="mark_del('{$sixth.id}');" class="btn btn-danger btn-del btn-disabled" title="删除"><i class="fa fa-trash"></i> 删除</a>
                                                                </td>
                                                            </tr>

                                                            {/volist}
                                                            {/if}
                                                        {/volist}
                                                        {/if}
                                                    {/volist}
                                                    {/if}
                                              {/volist}
                                              {/if}
                                            {/volist}
                                            {/if}
                                        {/volist}
                                        </tbody>


                                </table>
                            </div>
                            <div class="fixed-table-pagination" style="display: block;">
                                <div class="pull-right pagination">
                                        {$listpage}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/assets/libs/jquery/dist/jquery.min.js"></script>
<script>
    function mark_del(id){
        if(id){
            confirm("确认要删除，此标签目吗？");
        }
        $.ajax({
            type:"post",
            url:"/admin/mark/mark_del",
            data:{"id":id},
            dataType:"json",
            success:function(data){
                if(data.status==1){
                 alert(data.message);
                 location.reload();
                 }else{
                    alert(data.message);
                 }
            }
        });

    }

    function sort_sub(id){
        var url="/admin/mark/mark_sort?fid="+id;
        layer.open({
            type: 2,
            title: "排序", //不显示标题
            area: ['600px', '560px'],
            shadeClose: true, //点击遮罩关闭
            scrollbar: false, //是否出现滚动条
            content: [url,"no"],

        });

    }





</script>